<?php
require_once '../inc/phpmailer/class.phpmailer.php';
require_once '../inc/configuration.php';
require_once '../inc/connexion_db.php';

function send_mail($adresseMail, $sujet, $message) { 
 
$mail = new PHPMailer();

$mail->IsSMTP(); 

$mail->Host     = ""; 
//$mail->Username = ''; 
//$mail->Password = ''; 

$mail->From     = "";

$mail->AddAddress($adresseMail);

$mail->Subject  = $sujet;

$mail->Body     = $message;

$mail->WordWrap = 50;

if (!$mail->Send()) {
        $message_action["texte"] = "L'envoi a échouée !";
        $message_action["css_class"] = "alert-danger";
    } else {
        $message_action["texte"] = "L'envoi a réussie !";
        $message_action["css_class"] = "alert-success";
    }
$message_action = serialize($message_action);
header("location:$chemin?message_action=$message_action");

}     
?>